1. Field of the Invention
The present invention relates to an apparatus of motion estimation and a mode decision and a method thereof, and more particularly, to an apparatus capable of performing a motion estimation and a mode decision at a high speed in a scan format conversion, and a method thereof.
2. Description of the Related Art
Generally, methods to realize a digital image are divided into an interlaced scan and a progressive scan according to a structure of a frame. Referring to FIG. 1A, the interlaced scan constructs one frame, which is realized from two fields after one field (top field) scans odd lines (marked with a solid line) and another field (bottom field) scans even lines (marked with a dotted line). Therefore, a height of each of the fields is a half of a height of the frame. The above method is used to realize a high-resolution picture such as 1024×768 at a low frequency, but provides a flickering picture. On the other hand, referring to FIG. 1B, the progressive scan makes one frame by scanning an image signal one line by one line when realizing one frame. Compared with the interlaced scan, the progressive scan provides a less flickering picture.
Further, there are three types of frames defined in a MPEG standard: an inter coded frame (an I frame), a predictive coded frame (a P frame), and a bi-directionally-predictive coded frame (a B frame). The P frame and the B frame have a high-compression rate by performing motion compensation/estimation.
The I frame is coded without referring to other frames. The P frame is coded by referring to a past frame, in other words, a reverse I frame or a reverse P frame. Compression of the digital image is effectively performed when coding a predictive error and motion information after performing a motion information estimation and a motion compensation estimation between the reverse I frame or the reverse P frame and a current P frame.
The B frame is a frame having a highest compression rate. Furthermore, the B frame performs estimation by referring not only to the reverse I frame or the reverse P frame but also to a forward I frame or a forward P frame. The B frame uses the motion compensation estimation like the P frame. In addition, the B frame uses two reference frames, and selects the frame having a better estimation accuracy from two reference frames, and thus, the B frame has the highest compression rate. However, the B frame does not become a reference frame for other frames. Unlike the B frame, the I frame and the P frame become reference frames for other frames.
FIG. 2 is a view schematically showing a conventional transcoder. Referring to FIG. 2, the transcoder 200 has a variable length decoder (VLD) 201, first and second inverse quantizers (IQ) 203a and 203b, first and second inverse discrete cosine transformers (IDCT) 205a and 205b, first and second adders 207a and 207b, a motion compensator (MC) 209a, a motion estimation compensator (MEC) 209b, a down sampler (DSamp) 211, a subtractor 213, a discrete cosine transformer (DCT) 215, a quantizer (Q) 217, and a variable length coder (VLC) 219.
The VLD 201 reduces an amount of data by marking a length of a sign in accordance with a frequency of data generation. The first IQ 203a inverse quantizes DCT coefficients encoded by the VLD 201. The first IQ 203a provides the inverse quantized DCT coefficients to the first IDCT 205a and the second IDCT 205b. The first IDCT 205a and the second IDCT and 205b provide the first adder 207a with a predictive error signal that is obtained by inverse discrete cosine transforming the inverse quantized DCT coefficients. The first adder 207a adds the predictive error signal and a predictive signal. Here, ‘predictive’ is defined as calculating a difference of a pixel data between a frame and a field. In other words, after searching a macro block that best matches the macro block on a frame/field to be currently processed, among the data of a frame/field previously processed, a motion vector is detected based on a direction of motion of the best matched macro block.
The MC 209a predicts motion estimation according to an encoding order of motion vector input, and transmits a predictive signal to the first adder 207a. The first adder 207a adds the predictive error signal and the predictive signal, and transmits an added signal to the DSamp 211. The DSamp 211 reduces a size of the signal that is restored and added. A down scaled image signal is input into the subtractor 213. The subtractor 213 subtracts a predicted motion compensation signal from the down scaled image signal, and provides a gained predictive error signal to the DCT 215. The DCT 215 produces DCT of the gained predictive error signal, and provides DCT coefficients to the Q 217. The Q 217 quantizes the DCT coefficients.
The Q 217 provides the quantized DCT coefficients to the VLC 219 and at the same time, to the second IQ 203b. The second IQ 203b inversely quantizes the DCT coefficients. The second IQ 203b provides the inversely quantized DCT coefficients to the second IDCT 205b. The second IDCT 205b inverse discrete cosine transforms the inversely quantized DCT coefficients, and provides a gained predictive error signal to the second adder 207b. The second adder 207b adds the gained predictive error signal and the predictive predicted motion compensation signal, and provides an added signal to the MEC 209b. The MEC 209b predicts the motion compensation signal from the input motion vector according to an order of coding. The MEC 209b provides the predicted motion compensation signal to the subtractor 213, and at the same time, to the second adder 207b. The VLC 219 outputs a bit stream gained from variable length coding a type of the input picture, the motion vector, and the quantized DCT coefficients.
Furthermore, while the MPEG2 bit stream input into the transcoder is the interlaced scan, the output needs to be converted into a progressive scan method according to the displaying apparatus. However, the conventional transcoder can perform transcoding when an input scan format and an output scan format are the same. Therefore, there has not been introduced a transcoder capable of effectively re-encoding a converted sequence when the scan format input into a decoder and the scan format output from an encoder are different from each other.
In addition, the conventional transcoder cannot support 18 types of ATSC format. In other words, the transcoding to reduce a size or a bit rate of the image, or a frame rate has been introduced, but not for changing the scan format. For example, when a 1920×1080 interlaced input image is converted into a 720×480 progressive output image, the type of the frame is changed when transcoding, thus there is a limit to estimate the motion at a high velocity.